package com.colodoo.wvs.manager.bug.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * 漏洞实体类
 * @author colodoo
 */
@Entity
@Table(name = "bug")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Bug {
    /**
     * 漏洞ID
     */
    @Id
    @Column(name = "bug_id")
    private String bugId;

    /**
     * 漏洞名
     */
    @Column(name = "bug_name")
    private String bugName;

    /**
     * 父漏洞ID
     */
    @Column(name = "parent_bug_id")
    private String parentBugId;

    /**
     * 漏洞描述
     */
    @Column(name = "bug_desc")
    private String bugDesc;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 创建人
     */
    @Column(name = "create_user_id")
    private String createUserId;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "update_time")
    private Date updateTime;

    /**
     * 更新人
     */
    @Column(name = "update_user_id")
    private String updateUserId;

    /**
     * 备注
     */
    @Column(name = "remark")
    private String remark;

}